<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition>
		
		<p:fieldset legend="Item Request/s">
		<h:inputHidden value="#{listBean.prId}"/>
		<h:dataTable id="table2" value="#{listBean.requests}" var="itemreq">
			<h:column>
				<f:facet name="header">
					<h:outputText value="ID" />
				</f:facet>
				<h:outputText value="#{itemreq.id}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Description" />
				</f:facet>
				<h:outputText value="#{itemreq.masterItem.name}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Quantity" />
				</f:facet>
				<h:outputText value="#{itemreq.quantity}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Unit" />
				</f:facet>
				<h:outputText rendered="#{not empty itemreq.unit}" value="#{itemreq.unit.description}" />
				<h:outputText rendered="#{empty itemreq.unit}" value="#{itemreq.customUnit}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Remarks" />
				</f:facet>
				<h:outputText value="#{itemreq.remarks}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Action" />
				</f:facet>
				<h:commandButton styleClass="deletebutton imgtxtbtn" value="Delete"
					rendered="#{listBean.renderDelete}" 
					action="#{listBean.deleteRequestItem(itemreq.id)}"></h:commandButton>
			</h:column>
		</h:dataTable>
		</p:fieldset>
	</ui:composition>
</body>
</html>